<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<%--
  Created by IntelliJ IDEA.
  User: ZYZ
  Date: 2018/8/11
  Time: 8:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <link href="/vss/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>

    <link href="/vss/resources/menu/font-awesome.min.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" href="/vss/resources/menu/sidebar-menu.css">
    <link rel="stylesheet" href="/vss/resources/menu/menu.css">
    <link rel="stylesheet" href="/vss/resources/js/zxf_page.css">
    <script src="/vss/resources/js/jquery-1.11.1.min.js"></script>
    <script src="/vss/resources/app/js/base.js" type="text/javascript"></script>
    <script src="/vss/resources/js/user.js" type="text/javascript"></script>
    <script src="/vss/resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src= "/vss/resources/js/zxf_page.js" type="text/javascript"></script>






</head>
<body>

       <input class="ab" type ="hidden" id="test">

       <form action="/vss/user/userList" method="GET" id="form_search">
           <input id="inp_hid_pn" type="hidden" name="pn" value="${pageInfo.getCurrentPage()}">
       </form>


       <div class="container-fluid">
           <div class="row clearfix">
               <div class="col-md-12 column">
               </div>
               <div class="col-md-12 column">
                   <table class="table table-striped">
                       <thead>
                       <tr>


                           <form class="form-search" method="post" action="/vss/user/findUserByAccount" name="form1">
                               <input class="input-medium search-query" type="text" name="name"/>

                               <button type="submit" class="btn btn-success">查找用户</button>
                           </form>
                       </tr>

                       </tbody>
                   </table>
               </div>

           </div>

       </div>

<%--用户列表--%>
<div class="container-fluid">
    <div class="row clearfix">


    <table class="table table-striped" border="1">
                <thead>
                <tr>
                    <th>
                        ID
                    </th>

                    <th>
                        账号
                    </th>
                    <th>
                        积分
                    <th>
                        电子邮箱
                    </th>
                    <th>
                        电话
                    </th>
                    <th>
                        性别
                    </th>


                    <th>
                        用户类型
                    </th>


                    <th>
                        注册时间
                    </th>
                    <th>
                        修改信息
                    </th>
                    <th>
                        删除用户
                    </th>


                </tr>
                </thead>
                <tbody>

                <c:forEach var="user" items="${list}">

                    <tr id="${user.userId}" class="userClass">

                        <th>${user.userId }</th>
                        <th>${user.account }</th>
                        <th>${user.score }</th>
                        <th>${user.email }</th>
                        <th>${user.telephone }</th>
                        <th>${user.sex }</th>
                        <th>${user.userType}</th>
                        <th>${user.createDate}</th>









                        <th><a class="btn btn-success updateUserBtn" data-target="#updateUserDiag" data-toggle="modal" id="${user.userId}">修改</a></th>



                        <th><a class="btn btn-danger deleteUserBtn" data-target="#deleteUserById" data-toggle="modal" href="" method="post" id="${user.userId}">删除</a></th>





                    </tr>
                </c:forEach>

                </tbody>

            </table>




        <%--分页--%>
        <div class="row">
            <div class="col-md-10 col-md-offset-1">
                <div class="zxf_pagediv"></div>
            </div>

        </div>
    </div>






</div>

       <%--修改用户信息模态框--%>
       <div id="updateUserDiag" class="modal fade" aria-labelledby="myModalLabel"  aria-hidden="true">
           <div class="form-wrap">
               <div class="modal-dialog">
                   <div class="modal-content">
                       <div class="modal-header">
                           <button class="close" data-dismiss="modal">
                               <span>&times;</span>
                           </button>
                       </div>
                       <div class="modal-title">
                           <h1 class="text-center">修改</h1>
                       </div>

                           <form class="form-group" id="addForm2" name="form55"  novalidate >
                               <div class="modal-body" id="updateUserMsg">

                               </div>


                               <div class="modal-footer">
                                   <button class="btn btn-primary updateUser" type="submit" id="updateUser">提交</button>

                                   <button class="btn btn-danger" data-dismiss="modal">取消</button>
                               </div>

                           </form>

                   </div>
               </div>
           </div>
       </div>
       <%--修改用户模态框结束--%>


<%--删除用户模态框--%>
<div id="deleteUserById" class="modal fade" aria-labelledby="myModalLabel" >
    <div class="form-wrap">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal">
                        <span>&times;</span>
                    </button>
                </div>


                    <form class="form-group" id="form6" name="form6"
                          method="post">
                        <div class="modal-body" id="deleteUser" name="33">

                        </div>
                        <div class="modal-footer">
                            <button class="btn btn-primary deleteUser" type="submit" id="tijiao2">提交
                            </button>
                            <button class="btn btn-danger" data-dismiss="modal">取消</button>
                        </div>
                    </form>

            </div>
        </div>
    </div>
</div>
<%--删除用户模态框结束--%>




</body>

<script type="text/javascript">



    $(document).ready(function () {

        $(".zxf_pagediv").createPage({
//            pageNum: 10,//总页码
//            current: 1,//当前页
//            shownum: 10,//每页显示个数
            pageNum: ${pageInfo.getTotal()},//总页码
            current: ${pageInfo.getCurrentPage()},//当前页

            shownum: 8,//每页显示个数
            backfun: function (e) {
                $("#inp_hid_pn").attr("value", e.current);
                $("#form_search").submit();
            }
        });
    });
</script>



</html>
